/*   1:    */ package org.intellij.images.options.impl;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.JDOMExternalizable;
import com.intellij.openapi.util.WriteExternalException;
import org.intellij.images.options.EditorOptions;
import org.intellij.images.options.ExternalEditorOptions;
import org.intellij.images.options.Options;
import org.jdom.Element;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */ 
/*  13:    */ final class OptionsImpl
/*  14:    */   implements Options, JDOMExternalizable
/*  15:    */ {
/*  16:    */   private final PropertyChangeSupport a;
/*  17:    */   private final EditorOptions b;
/*  18:    */   private final ExternalEditorOptions c;
/*  19:    */   
/*  20:    */   OptionsImpl()
/*  21:    */   {
/*  22: 44 */     this.a = new PropertyChangeSupport(this);
/*  23: 45 */     this.b = new EditorOptionsImpl(this.a);
/*  24: 46 */     this.c = new ExternalEditorOptionsImpl(this.a);
/*  25:    */   }
/*  26:    */   
/*  27:    */   public EditorOptions getEditorOptions()
/*  28:    */   {
/*  29: 50 */     return this.b;
/*  30:    */   }
/*  31:    */   
/*  32:    */   public ExternalEditorOptions getExternalEditorOptions()
/*  33:    */   {
/*  34: 54 */     return this.c;
/*  35:    */   }
/*  36:    */   
/*  37:    */   public void inject(Options paramOptions)
/*  38:    */   {
/*  39: 58 */     this.b.inject(paramOptions.getEditorOptions());
/*  40: 59 */     this.c.inject(paramOptions.getExternalEditorOptions());
/*  41:    */   }
/*  42:    */   
/*  43:    */   public void addPropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
/*  44:    */   {
/*  45: 63 */     this.a.addPropertyChangeListener(paramPropertyChangeListener);
/*  46:    */   }
/*  47:    */   
/*  48:    */   public void addPropertyChangeListener(String paramString, PropertyChangeListener paramPropertyChangeListener)
/*  49:    */   {
/*  50: 67 */     this.a.addPropertyChangeListener(paramString, paramPropertyChangeListener);
/*  51:    */   }
/*  52:    */   
/*  53:    */   public void removePropertyChangeListener(PropertyChangeListener paramPropertyChangeListener)
/*  54:    */   {
/*  55: 71 */     this.a.removePropertyChangeListener(paramPropertyChangeListener);
/*  56:    */   }
/*  57:    */   
/*  58:    */   public void removePropertyChangeListener(String paramString, PropertyChangeListener paramPropertyChangeListener)
/*  59:    */   {
/*  60: 75 */     this.a.removePropertyChangeListener(paramString, paramPropertyChangeListener);
/*  61:    */   }
/*  62:    */   
/*  63:    */   public boolean setOption(String paramString, Object paramObject)
/*  64:    */   {
/*  65: 79 */     return (this.b.setOption(paramString, paramObject)) || (this.c.setOption(paramString, paramObject));
/*  66:    */   }
/*  67:    */   
/*  68:    */   public void readExternal(Element paramElement)
/*  69:    */     throws InvalidDataException
/*  70:    */   {
/*  71: 83 */     ((JDOMExternalizable)this.b).readExternal(paramElement);
/*  72: 84 */     ((JDOMExternalizable)this.c).readExternal(paramElement);
/*  73:    */   }
/*  74:    */   
/*  75:    */   public void writeExternal(Element paramElement)
/*  76:    */     throws WriteExternalException
/*  77:    */   {
/*  78: 88 */     ((JDOMExternalizable)this.b).writeExternal(paramElement);
/*  79: 89 */     ((JDOMExternalizable)this.c).writeExternal(paramElement);
/*  80:    */   }
/*  81:    */   
/*  82:    */   public boolean equals(Object paramObject)
/*  83:    */   {
/*  84: 93 */     if (paramObject == this) {
/*  85: 94 */       return true;
/*  86:    */     }
/*  87: 96 */     if (!(paramObject instanceof Options)) {
/*  88: 97 */       return false;
/*  89:    */     }
/*  90: 99 */     Options localOptions = (Options)paramObject;
/*  91:100 */     EditorOptions localEditorOptions = localOptions.getEditorOptions();
/*  92:101 */     ExternalEditorOptions localExternalEditorOptions = localOptions.getExternalEditorOptions();
/*  93:102 */     return (localEditorOptions != null) && (localEditorOptions.equals(getEditorOptions())) && (localExternalEditorOptions != null) && (localExternalEditorOptions.equals(getExternalEditorOptions()));
/*  94:    */   }
/*  95:    */   
/*  96:    */   public int hashCode()
/*  97:    */   {
/*  98:108 */     int i = this.b != null ? this.b.hashCode() : 0;
/*  99:109 */     i = 29 * i + (this.c != null ? this.c.hashCode() : 0);
/* 100:110 */     return i;
/* 101:    */   }
/* 102:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.intellij.images.options.impl.OptionsImpl

 * JD-Core Version:    0.7.0.1

 */